package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 他行转账成功
 */
public class TrOtherSuccessPp extends BasePopupView {
    Unbinder bind;
    @BindView(R.id.switch_success_name)
    TextView switchSuccessName;
    @BindView(R.id.switch_success_usernmae)
    TextView switchSuccessUsernmae;
    @BindView(R.id.switch_success_usernum)
    TextView switchSuccessUsernum;
    @BindView(R.id.switch_success_injoin_name)
    TextView switchSuccessInjoinName;
    @BindView(R.id.switch_success_injoin_num)
    TextView switchSuccessInjoinNum;
    @BindView(R.id.switch_success_money)
    TextView switchSuccessMoney;
    @BindView(R.id.switch_success_okbtn)
    Button switchSuccessOkbtn;
    TrOtherSuccessPpCallBack mTrOtherSuccessPpCallBack;

    public TrOtherSuccessPp(@NonNull Context context, TrOtherSuccessPpCallBack trOtherSuccessPpCallBack) {
        super(context);
        mTrOtherSuccessPpCallBack = trOtherSuccessPpCallBack;

    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.tr_other_successpp;
    }


    String username;
    String userNum;
    String injonName;
    String injoinNum;
    String money;
    String name;

    public void setUsername(String username) {
        this.username = username;
    }

    public void setUserNum(String userNum) {
        this.userNum = userNum;
    }

    public void setInjonName(String injonName) {
        this.injonName = injonName;
    }

    public void setInjoinNum(String injoinNum) {
        this.injoinNum = injoinNum;
    }

    public void setMoney(String money) {
        this.money = money;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        bind = ButterKnife.bind(this);
        switchSuccessName.setText(name);//操作类型
        switchSuccessUsernmae.setText(username);//用户名
        switchSuccessUsernum.setText(userNum);//用户卡好
        switchSuccessInjoinName.setText(injonName);//存入姓名
        switchSuccessInjoinNum.setText(injoinNum);//存入卡号
        switchSuccessMoney.setText(money);//金额
    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }

    @OnClick(R.id.switch_success_okbtn)
    public void onViewClicked() {
        mTrOtherSuccessPpCallBack.OtherSuccessPpCall();
    }

    public interface TrOtherSuccessPpCallBack {
        void OtherSuccessPpCall();
    }

}
